<?php
class Common extends Action {
	Public function _initialize(){
		$this->checklogin();
	}
	
	function checklogin(){  
		
		if(empty($_SESSION['UserName']) || empty($_SESSION['UserID'])){    //检查一下session是不是为空  
			
			/*if(empty($_COOKIE['nova_username']) || empty($_COOKIE['nova_password'])){  //如果session为空，并且用户没有选择记录登录状  
				$this->redirect('/Login/index');
			}
			else{   //用户选择了记住登录状态  
				$user = M("user");
				$userinfo = $user->where("username =".$_COOKIE['nova_username'])->find();
				if(empty($userinfo)){
					$this->redirect('/Login/index');
				}else{
					if($userinfo['password'] == cookie('nova_password'))
					{
						session('userid',$userinfo['id']);
						session('username',cookie('nova_username'));
					}
					else
					{
						$this->redirect('/Login/index');
					}
				}  
			}  */
			if($_POST['uploadifySessionID'] != ""){

				if (isset($_POST['uploadifySessionID'])) {
					session_id($_POST['uploadifySessionID']);
				}
			}
			else{
				$this->redirect('/Login/index');	
			}
		 }
	}

}
